package com.yenroc.ho.netty;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * @author： heyanpeng
 * @date： 2021/7/27
 */
@Component
public class NettyBooter implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        try {
            NettyServer.getInstance().start();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
